#include "GameEnemy.h"
#include "Common.h"
#ifndef __GAMENEMY_TANK_H__
#define  __GAMENEMY_TANK_H__

template<>
class GameEnemy<EE_tank> :public GameSprite
{
public:
	static const EEnemy EnemyType = EE_tank;
	GameEnemy()
	{
		dir = 1;
		dis = 0;
	}
public:
	void doAI()
	{
		CCPoint pt = getPosition();
		if (dir > 0)
		{
			dis += 2;
			setPosition(ccp(pt.x + 2, pt.y));
			if (dis > 100)
			{
				dir = -1;
			}
		}
		else
		{
			if (dis < -100)
			{
				dir = 1;
			}
			dis -= 2;
			setPosition(ccp(pt.x - 2, pt.y));
		}
	}
private:
	int dir;
	int dis;
};
#endif